<template>
	<div class="ffffff mainpadding radius margin_top">
		<div class="text_h color_three">{{text}}</div>
		<div class="margin_top">
			<el-table :data="list.data" border style="width: 100%">
				<el-table-column prop="memo" align="center" label="类型" label-class-name="color_zero" class-name="color_three"></el-table-column>
				<el-table-column prop="createtime_text" align="center" label="时间" label-class-name="color_zero" class-name="color_three"></el-table-column>
				<el-table-column prop="money" align="center" label="金额" label-class-name="color_zero" class-name="color_theme"></el-table-column>
			</el-table>
		</div>
		<div class="flexcenter margin_top" v-if="list.total > 15">
			<el-pagination background layout="prev, pager, next" :page-size="15" :total="list.total"
				@current-change="tuijianchange">
			</el-pagination>
		</div>
	</div>
</template>

<script>
	import {money_list} from "@/API/yue"
	export default{
		data(){
			return {
				text:"余额明细",
				tableData: [{
					name: '充值',
					date: '2023-08-18 16:10:20',
					address: '+56.00'
				}, {
					name: '消费',
					date: '2023-08-18 16:10:20',
					address: '-56.00'
				}, {
					name: '充值',
					date: '2023-08-18 16:10:20',
					address: '+56.00'
				}, {
					name: '充值',
					date: '2023-08-18 16:10:20',
					address: '+56.00'
				}, {
					name: '消费',
					date: '2023-08-18 16:10:20',
					address: '-56.00'
				}],
				page:1,
				list:{
					data:[]
				}
			}
		},
		created() {
			console.log(this.$route)
			this.text=this.$route.query.name
			this.init() //用户信息
		},
		methods:{
			init(page) {
				money_list({
					page: page || 1,
				}).then(res => {
					this.list = res.data.data
					this.list.data = res.data.data.data;
				})
			},
			// 推荐页码改变调用接口
			tuijianchange(val) {
				this.init(val)
			},
		}
	}
</script>

<style lang="scss" scoped>
	/* ::v-deep .el-table{
		th{
			text-align: center;
			// color: #000000;
			// background-color: #EBECF0;
		}
		td{
			text-align: center;
			color: #333333;
		}
	} */
</style>